///PHILOTES Source Code.  (C)2012 PhiloLabs
#pragma once

#ifndef _OgreExternalTextureSourceManager_H
#define _OgreExternalTextureSourceManager_H

/***************************************************************************
OgreExternalTextureSourceManager.h  -  
	Handles the registering / unregistering of texture modifier plugins

-------------------
date                 : Jan 1 2004
email                : pjcast@yahoo.com
***************************************************************************/
#include "OgreSingleton.h"
#include "OgreString.h"
#include "OgreResourceGroupManager.h"
#include "OgreExternalTextureSource.h"

namespace Ogre
{
	
	
	
	class _OgreExport ExternalTextureSourceManager : public Singleton<ExternalTextureSourceManager>, public MemAlloc_Resource
	{
	public:
		
		ExternalTextureSourceManager();
		
		~ExternalTextureSourceManager();

		
		void setCurrentPlugIn( const String& sTexturePlugInType );

		
		ExternalTextureSource* getCurrentPlugIn( void ) const { return mCurrExternalTextureSource; }
	
		
		void destroyAdvancedTexture( const String& sTextureName,
			const String& groupName = ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);

		
		ExternalTextureSource* getExternalTextureSource( const String& sTexturePlugInType );

		
		void setExternalTextureSource( const String& sTexturePlugInType, ExternalTextureSource* pTextureSystem );

        
        static ExternalTextureSourceManager& getSingleton(void);
        
        static ExternalTextureSourceManager* getSingletonPtr(void);
	protected:
		//The current texture controller selected
		ExternalTextureSource* mCurrExternalTextureSource;
		
        // Collection of loaded texture System PlugIns, keyed by registered type
        typedef map< String, ExternalTextureSource*>::type TextureSystemList;
        TextureSystemList mTextureSystems;
    };
	
	
} 
#endif
